﻿@model Ja.Mvc.Acdf.Models.ChangeProfileViewModel
@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}

@{
    ViewBag.Title = "Edit";
}

<p class="text-success">@ViewBag.StatusMessage</p>

<h2>Edition du profil de @Html.DisplayFor(model => model.UserName)</h2>

@using (Html.BeginForm("ChangeProfile", "Manage", FormMethod.Post, new { @class = "form-horizontal", role = "form" }))
{
    <div class="form-horizontal">
        @Html.AntiForgeryToken()
        <div class="container">
            @Html.ValidationSummary(true)

            <div class="form-group">
                @Html.LabelFor(model => model.UserName, new { @class = "control-label col-md-2" })
                <div class="col-md-10">
                    @Html.TextBoxFor(model => model.UserName, new { @class = "form-control", placeholder = "User name", @readonly = "readonly" })
                    @Html.ValidationMessageFor(model => model.UserName)
                </div>
            </div>

            <div class="form-group">
                @Html.LabelFor(model => model.Pseudo, new { @class = "control-label col-md-2" })
                <div class="col-md-10">
                    @Html.TextBoxFor(model => model.Pseudo, new { @class = "form-control", placeholder = "Pseudo" })
                    @Html.ValidationMessageFor(model => model.Pseudo)
                </div>
            </div>

            <div class="form-group">
                @Html.LabelFor(model => model.FirstName, new { @class = "control-label col-md-2" })
                <div class="col-md-10">
                    @Html.TextBoxFor(model => model.FirstName, new { @class = "form-control", placeholder = "First name" })
                    @Html.ValidationMessageFor(model => model.FirstName)
                </div>
            </div>

            <div class="form-group">
                @Html.LabelFor(model => model.LastName, new { @class = "control-label col-md-2" })
                <div class="col-md-10">
                    @Html.TextBoxFor(model => model.LastName, new { @class = "form-control", placeholder = "Last name" })
                    @Html.ValidationMessageFor(model => model.LastName)
                </div>
            </div>

            <div class="form-group">
                @Html.LabelFor(model => model.Email, new { @class = "control-label col-md-2" })
                <div class="col-md-10">
                    @Html.TextBoxFor(model => model.Email, new { @class = "form-control", placeholder = "Email" })
                    @Html.ValidationMessageFor(model => model.Email)
                </div>
            </div>
            @*<div class="form-group">
                @Html.LabelFor(model => model.BirthDate, new { @class = "col-md-2 control-label" })
                <div class="col-md-10">
                    @Html.TextBoxFor(model => model.BirthDate, new { @class = "form-control" })
                    @Html.ValidationMessageFor(model => model.BirthDate)
                </div>
            </div>*@
            <div class="form-group">
                @Html.LabelFor(model => model.BirthDate, new { @class = "col-md-2 control-label" })
                <div class="col-md-10">
                  Day:  @Html.DropDownListFor(model => model.BirthDateDay, new SelectList(Model.Day, "Value", "Text"), new { selected = "model => model.BirthDateDay" })
                  Month:  @Html.DropDownListFor(model => model.BirthDateMonth, new SelectList(Model.Month, "Value", "Text"), new { selected = "model => model.BirthDateMonth" })
                  Year:  @Html.DropDownListFor(model => model.BirthDateYear, new SelectList(Model.Year, "Value", "Text"), new { selected = "model => model.BirthDateYear" })
                </div>
            </div>
            <div class="form-group">
                @Html.LabelFor(model => model.FirstYearSchool, new { @class = "col-md-2 control-label" })
                <div class="col-md-10">
                    @*@Html.TextBoxFor(model => model.FirstYearSchool, new { @class = "form-control" })*@
                    @Html.DropDownListFor(model => model.FirstYearSchool, new SelectList(Model.YearFirst, "Value", "Text"), new { selected = "model => model.FirstYearSchool" })
                </div>
            </div>
            <div class="form-group">
                @Html.LabelFor(model => model.LastYearSchool, new { @class = "col-md-2 control-label" })
                <div class="col-md-10">
                    @*@Html.TextBoxFor(model => model.LastYearSchool, new { @class = "form-control" })*@
                    @Html.DropDownListFor(model => model.LastYearSchool, new SelectList(Model.YearLast, "Value", "Text"), new { selected = "model => model.LastYearSchool" })
                </div>
            </div>
            <div class="form-group">
                @Html.LabelFor(model => model.LastClass, new { @class = "col-md-2 control-label" })
                <div class="col-md-10">
                    @Html.TextBoxFor(model => model.LastClass, new { @class = "form-control" })
                </div>
            </div>
            <div class="form-group">
                @Html.LabelFor(model => model.ActualCity, new { @class = "col-md-2 control-label" })
                <div class="col-md-10">
                    @Html.TextBoxFor(model => model.ActualCity, new { @class = "form-control" })
                </div>
            </div>
            <div class="form-group">
                @Html.LabelFor(model => model.ActualCountry, new { @class = "col-md-2 control-label" })
                <div class="col-md-10">
                    @*@Html.TextBoxFor(model => model.ActualCountry, new { @class = "form-control" })*@
                    @Html.DropDownListFor(model => model.ActualCountry, new SelectList(Model.Countries, "Value", "Text"), new { selected = "model => model.ActualCountry" })
                </div>
            </div>



            <div class="form-group">
                @Html.LabelFor(model => model.RegistrationDate, new { @class = "col-md-2 control-label" })
                <div class="col-md-10">
                    @Html.TextBoxFor(model => model.RegistrationDate, new { @class = "form-control", @readonly = "readonly" , @disabled = "disabled" })
                </div>
            </div>
            <div class="form-group">
                <div class="col-md-offset-2 col-md-10">
                    <input type="submit" value="Change profile" class="btn btn-default" />
                </div>
            </div>
            <div>
                <span class="btn btn-default">@Html.ActionLink("Back to profile", "Index")</span>
            </div>
        </div>
    </div>

}